#include "stdafx.h"
#include "Contracts.h"
#include "nef.h"
#include <algorithm>
#include "ExoticContracts.h"


class ExoticComponent
	: public IMyComponent
{
public:
	virtual std::string GetDescription() const
	{
		return "Exotic Component";
	}

	virtual std::string ManipulateString( const std::string &a, const std::string &b ) 
	{
		std::string ra = a;
		std::string rb = b;

		std::reverse(ra.begin(), ra.end());
		std::reverse(rb.begin(), rb.end());

		return rb + _separator->GetSeparator() + ra;
	}

	void SetSeparator(const ISeparator::Ptr &sep)
	{
		_separator = sep;
	}

	typedef nef::nef_import_fn<ExoticComponent, ISeparator, &ExoticComponent::SetSeparator, EXOTIC_CONTRACT, true> import0;

private:
	ISeparator::Ptr _separator;
};

nef::nef_export<ExoticComponent, IMyComponent> export_exotic_comp;